/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chapter3;

/**
 *
 * @author Denise Carolina
 */
public class ShadowExamples {

    Bar myBar = new Bar();
    static int size = 7;

    static void changeIt(int size){
        size = size + 200;
        System.out.println("size inside:: " + size);
    }

    void changeIt(Bar myBar){
        myBar.barNum = 99;
        System.out.println("inside change it 1:: " + myBar.barNum);
        myBar = new Bar();
        myBar.barNum = 420;
        System.out.println("inside change it 2:: " + myBar.barNum);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        ShadowExamples se = new ShadowExamples();
        System.out.println("size:: " + se.size);
        changeIt(se.size);
        System.out.println("size after changeIt: " + se.size);

        System.out.println("myBar.barNum is : " + se.myBar.barNum);
        se.changeIt(se.myBar);
        System.out.println("myBar.barNum is after change it : " + se.myBar.barNum);

        System.out.println("size:: " + size);
        changeIt(size);
        System.out.println("size after changeIt: " + size);
    }

}

class Bar {

    int barNum = 28;
}
